package br.usp.icmc.client.dao;



import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;


public class HibernateUtility {

    private static SessionFactory sf = new Configuration().configure().buildSessionFactory();
    private static Session se = sf.openSession();
    private static Transaction tx;
                
    public static Session getSession(){
        return  se;
    }
    
    public static void beginTransaction(){
        tx = se.beginTransaction();
    }
    
    public static void commitTransaction(){
        tx.commit();
    }
}
